package com.exam.controller.exam;


import com.exam.common.Result;
import com.exam.openFeign.ThirdPartyClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/thirdPartService")
public class ThirdPartyController {
    @Autowired
    private ThirdPartyClient thirdPartyClient;

    /**
     * 发送短信验证码
     */
    @GetMapping("/email/getAuthCode")
    public Result getAuthCode(String receiver){
        System.out.println(receiver);
        return thirdPartyClient.getAuthCode(receiver);
    }

    /**
     * OSS云存储
     */
    @GetMapping("/oss/policy")
    @PreAuthorize("hasRole('Stuent')")
    public Result policy(){
        return thirdPartyClient.policy();
    }
}
